// Copyright (c) 2006 Zorm
// Released under the MIT License

#ifndef GLCONTEXT_H
#define GLCONTEXT_H

class GLContext {

public:
	GLContext(HWND winHWND) : m_windowHWND(winHWND) { m_centerx = 0; m_centery = 0; }
	bool Init();
	void Swap();
	void Resize(int width, int height);
	void DrawString(int latitude, int longitude, double scale, char *text);
	void Draw();
	void CaptureScreen(char *filename);
	void LoadMatrix();
	bool Unproject(double x, double y, double *lat, double *lon);
	bool UnprojectXY(double x, double y, double *newx, double *newy);
	
	double GetCenterX() { return m_centerx; }
	double GetCenterY() { return m_centery; }
	
private:
	HWND m_windowHWND;
    HDC m_windowDC;
    HGLRC m_windowRC;
    double m_centerx, m_centery;
    GLuint m_fontBase;
    GLdouble m_modelView[16], m_projection[16];
    GLint m_viewport[4];

};

#endif
